﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AgentPage_AgentBackOrder : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title="生成的订单";
        if ((string)Session["userId"] == null || (string)Session["login"] != "havelogin" || (string)Session["usertype"] != "agentsrub")
        {

            Response.Redirect("~/LoginPage/login.aspx");

        }

        if (Session["Order"]!=null)
        {
            Label_orderID.Text = ((Order)Session["Order"]).OrderID;
            Label_hotelname.Text = ((Order)Session["Order"]).Hotel.Name;
            Label_hoteladdress.Text = ((Order)Session["Order"]).Hotel.Province
                                    +((Order)Session["Order"]).Hotel.City
                                    +((Order)Session["Order"]).Hotel.County
                                    +((Order)Session["Order"]).Hotel.Address;

            Label_hoteltelnum.Text = ((Order)Session["Order"]).Hotel.Telephonenumber;
            Label_agentID.Text = ((Order)Session["Order"]).Agent.AgentID;

            foreach (Student student in ((Order)Session["Order"]).StudenList)
            {
                Label_student.Text = Label_student.Text + student.Name + " ， ";
            }
            foreach (Room room in ((Order)Session["Order"]).RoomList)
            {
                Label_room.Text = Label_room.Text + room.Name + " ， ";
            }

            Label_time.Text = ((Order)Session["Order"]).Starttime + "-" + ((Order)Session["Order"]).Endtime;
            Label_totalprice.Text = ((Order)Session["Order"]).Totalprice+"元";

        }
        else
        {
            Response.Write("<script language=javascript > alert('订单未录入！');</script>");
        }
        
    }

    protected void Button_OK_Click(object sender, EventArgs e)
    {

        Response.Write("<script>window.opener=null;window.close();</script>");
    }
}